import { postData } from '@/api/common/index';

const baseUserInfo = '/api/user-info';

// 获取用户所有信息（分页）
export function getUserAllInfoPage(
	params: any,
	pageNo: number | null | undefined,
	pageSize: number | null | undefined,
): Promise<any> {
	const url =
		baseUserInfo +
		'/get-all-user-info' +
		'?pageNum=' +
		(pageNo ? pageNo : 1) +
		'&pageSize=' +
		(pageSize ? pageSize : 10);
	return postData(url, params);
}

// 导出所有用户信息
export function exportAllUserInfoApi(params: any): Promise<any> {
	const url = baseUserInfo + '/export-all-user-info';
	return postData(url, params, {
		responseType: 'blob', // 设置响应类型为blob，用于文件下载
		headers: {
			'Content-Type': 'application/json',
		},
	});
}
